#!/usr/bin/env python3

import atheris
import sys


def TestOneInput(data):
    """
    测试函数，接收模糊测试数据
    """
    if len(data) < 5:
        return
    
    try:
        # 尝试解码为字符串
        test_string = data.decode('utf-8', errors='ignore')
        
        # 执行一些操作
        if "test" in test_string:
            result = test_string.upper()
        else:
            result = test_string.lower()
            
        # 检查一些条件
        if len(result) > 100:
            raise ValueError("String too long")
            
    except Exception as e:
        # 捕获但不处理异常
        pass


def main():
    atheris.Setup(sys.argv, TestOneInput)
    atheris.Fuzz()


if __name__ == "__main__":
    main() 